package popcorn.ticket.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfigInfo {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2016102900775244";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDTLkTny3d88rOAyKN48JoTGwBnP+TWSSNCO7HOqqbH3vABEBE2zu1bNJ2AMQwwZmhxX5l6lCFgl0jmIWkRqnhJi3zJWKLqQiTpXRlfwco98zEfUY5UUlvH1M4x+zkX623cPZl26ikksTH0DTMnXo3ZJDCHbtxZrMGld/fwUST2vVSGBklZU1fJyjEBMdwTCCmEdmbeNFoUgeuT+28AUd3D+UsiRQ60P6y1FNuD38qErmqWdW2yPHXxEszbZWn5BePEQ99Wb3sBI78W76ues3Eucwrhzi9+PSSeAt7Vexsq+Y4kFEUIcoWuhb//Q32LITch5toQXaFafP68yiS8UzwXAgMBAAECggEAOVJc18Ity9ehC7rqTICagccZg+0e819k16yWZe+CV8xWvyMaWRMv8ErG2a32jgiuHuABK/mbWbmWywiUmXv5LJVVKN4LUqTjmghwQ8K5X7lsQwEDLjYwvXww//YeGDUKW/bIejOzOUdztLgEg5Ix1JfzKD/aRekToxN+VFfiParF7fRTaHF2ozvusyNqu+9FsAqf34RhwP5NJZZYFMseVtGeIdDqWakt4zuP67SIqWB6QUcKuSo9DiVoIW7sYns0Z98wUI0vUiB58j7VtfnmiR0v3oRp91aBaUFkbtMrgF+3AHnp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UM4rIfBPkDkkiYxUpfxLIp6JDWxTqtAaXn1REx/Tjc3ue0SlgiR6aN3dGO6Q8TR34WcOx5Bt2yNgKQVNMC2wIkYJi02w5fQh4QKBgBGCNemziZ6bn2G6I7ywIKFuxeoDka5JtsdWTErzZo0HeuI8qizVMr7/52TRaqShpP1Ag9ZEwMYlyLiA4Z0IWSMu//Pcmkxm52Jsu333cRkYyhXB9WQKkuntFRM3hOG+bMRGr2au6GcWwFe+l1e74gZo3zZgqsxBkYoupUZSlXlZ";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkvrfJNMIfVawR0HgJIvvbKLSuNLtp43ikSOIQjP4KQ1oAadKiQF5kLzaTT7+Y4Tf/DKRoOESIH/6Jusu4TyJR55dsrttRuHkPnU2EJjqNTGgncDV8eOlVFomwwQy9+mHkOjVDG0rlIkQ39zK3e1U12K6FflZ6rztlBgNy0Fhw4yFhkVlfcIjDumMnPIvBT6VRj3U3cFGKYdoXp+DGN0tYemqlObGdA0gtEIpxXNeTPtmi9jy6Lql0wsdawz3RQr7wR27BWaFynJlMZLnH1PLUCu0cxbT/3lKPydGLVJPECKmONSfH0D3XPIzy4TgvMCeUkVIGF65XTKUiNZQ+/oKOQIDAQAB+Y4Tf/DKRoOESIH/6Jusu4TyJR55dsrttRuHkPnU2EJjqNTGgncDV8eOlVFomwwQy9+mHkOjVDG0rlIkQ39zK3e1U12K6FflZ6rztlBgNy0Fhw4yFhkVlfcIjDumMnPIvBT6VRj3U3cFGKYdoXp+DGN0tYemqlObGdA0gtEIpxXNeTPtmi9jy6Lql0wsdawz3RQr7wR27BWaFynJlMZLnH1PLUCu0cxbT/3lKPydGLVJPECKmONSfH0D3XPIzy4TgvMCeUkVIGF65XTKUiNZQ+/oKOQIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://localhost:8080/My_Popcorn/notify_url";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://localhost:8080/My_Popcorn/return_url";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "D:\\支付宝沙箱\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

